

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>A Tutorial for the Odespy Interface to ODE Solvers</title>
    
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    './',
        VERSION:     '1.0',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    <script type="text/javascript" src="_static/sidebar.js"></script>

        <script src="http://sagecell.sagemath.org/static/jquery.min.js"></script>
        <script src="http://sagecell.sagemath.org/static/embedded_sagecell.js"></script>

        <script>sagecell.makeSagecell({inputLocation: ".sage"});</script>

        <style type="text/css">
                .sagecell .CodeMirror-scroll {
                        overflow-y: hidden;
                        overflow-x: auto;
                }
                .sagecell .CodeMirror {
                        height: auto;
                }
        </style>

    
    <link rel="top" title="A Tutorial for the Odespy Interface to ODE Solvers" href="#" />
    <link rel="next" title="A Tutorial for the Odespy Interface to ODE Solvers" href="main_odespy.html" />
 
  
       <style type="text/css">
         div.admonition {
           background-color: whiteSmoke;
           border: 1px solid #bababa;
         }
       </style>
      </head>
    
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="main_odespy.html" title="A Tutorial for the Odespy Interface to ODE Solvers"
             accesskey="N">next</a> |</li>
        <li><a href="#">A Tutorial for the Odespy Interface to ODE Solvers</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="a-tutorial-for-the-odespy-interface-to-ode-solvers">
<h1>A Tutorial for the Odespy Interface to ODE Solvers<a class="headerlink" href="#a-tutorial-for-the-odespy-interface-to-ode-solvers" title="Permalink to this headline">¶</a></h1>
<p>Contents:</p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="main_odespy.html">A Tutorial for the Odespy Interface to ODE Solvers</a><ul>
<li class="toctree-l2"><a class="reference internal" href="main_odespy.html#motivation">Motivation</a><ul>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#traditional-approach">Traditional Approach</a></li>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#odespy-s-unified-interface">Odespy&#8217;s Unified Interface</a></li>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#methods-and-implementations-offered-by-odespy">Methods and Implementations Offered by Odespy</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="main_odespy.html#installation">Installation</a></li>
<li class="toctree-l2"><a class="reference internal" href="main_odespy.html#basic-usage">Basic Usage</a><ul>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#overview">Overview</a></li>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#first-example-logistic-growth">First Example: Logistic Growth</a></li>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#parameters-in-the-right-hand-side-function">Parameters in the Right-Hand Side Function</a></li>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#continuing-a-previous-simulation">Continuing a Previous Simulation</a></li>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#termination-criterion-for-the-simulation">Termination Criterion for the Simulation</a></li>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#a-class-based-implementation">A Class-Based Implementation</a></li>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#using-other-symbols">Using Other Symbols</a></li>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#example-solving-an-ode-system">Example: Solving an ODE System</a></li>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#the-euler-cromer-method">The Euler-Cromer Method</a></li>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#testing-several-methods">Testing Several Methods</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="main_odespy.html#more-advanced-implementations">More Advanced Implementations</a><ul>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#make-a-subclass-of-class-problem">Make a Subclass of Class Problem</a></li>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#example-solving-a-complex-ode-problem">Example: Solving a Complex ODE Problem</a></li>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#avoiding-callbacks-to-python">Avoiding Callbacks to Python</a></li>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#example-solving-a-stochastic-differential-equation">Example: Solving a Stochastic Differential Equation</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="main_odespy.html#adaptive-methods">Adaptive Methods</a><ul>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#the-test-problem">The Test Problem</a></li>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#running-simple-methods">Running Simple Methods</a></li>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#running-the-runge-kutta-fehlberg-method">Running the Runge-Kutta-Fehlberg Method</a></li>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#testing-more-adaptive-solvers">Testing More Adaptive Solvers</a></li>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#extensive-testing">Extensive Testing</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="main_odespy.html#solving-partial-differential-equations">Solving Partial Differential Equations</a><ul>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#discretization-in-space">Discretization in Space</a></li>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#implementation">Implementation</a></li>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#experiments">Experiments</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="main_odespy.html#inner-workings-of-the-package">Inner Workings of the Package</a><ul>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#solver-parameters">Solver Parameters</a></li>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#solver-classes">Solver Classes</a></li>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#a-very-simple-subclass">A Very Simple Subclass</a></li>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#a-subclass-with-more-code">A Subclass with More Code</a></li>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#a-simple-example-of-an-implicit-method">A Simple Example of an Implicit Method</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="main_odespy.html#troubleshooting">Troubleshooting</a><ul>
<li class="toctree-l3"><a class="reference internal" href="main_odespy.html#constructor-takes-exactly-two-arguments-5-given">Constructor takes exactly two arguments, 5 given</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="section" id="indices-and-tables">
<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h1>
<ul class="simple">
<li><a class="reference internal" href="genindex.html"><em>Index</em></a></li>
<li><a class="reference internal" href="py-modindex.html"><em>Module Index</em></a></li>
<li><a class="reference internal" href="search.html"><em>Search Page</em></a></li>
</ul>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <center>
            <p class="logo"><a href="http://cbc.simula.no/" title="Go to Center for Biomedical Computing">
              <img class="logo" src="_static/cbc_logo.png" alt="Logo"/>
            </a></p>
            </center>
  <h3><a href="#">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">A Tutorial for the Odespy Interface to ODE Solvers</a></li>
<li><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li>
</ul>

  <h4>Next topic</h4>
  <p class="topless"><a href="main_odespy.html"
                        title="next chapter">A Tutorial for the Odespy Interface to ODE Solvers</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="_sources/index.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" size="18" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="main_odespy.html" title="A Tutorial for the Odespy Interface to ODE Solvers"
             >next</a> |</li>
        <li><a href="#">A Tutorial for the Odespy Interface to ODE Solvers</a> &raquo;</li> 
      </ul>
    </div>
<div class="wrapper">
  <div class="footer">
  <a href="http://cbc.simula.no"><img src="_static/cbc_banner.png" width="100%"><a>
  </div>
</div>

  </body>
</html>